Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RLlib] Fix IMPALA/APPO learning behavior: Fix EnvRunner sync bug, GPU loader thread, enable local learner w/ GPU. #48314

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Oct 29, 2024

Enhance IMPALA/APPO learning behavior:

  • Fix EnvRunner sync bug (when running with lots of EnvRunners, only those few that - by chance - return samples in the same call to training_step as IMPALA/APPO performs the Learner update, get weight-synched. All others (even though they also contributed to the train batch) stay behind, leading to a very large off-policyness.
  • GPU loader thread: Disable loading to the GPU on the NumpyToTensor connector. This load process should be handled entirely by the n GPU loader threads.
  • Enable local learner w/ GPU: When using a local Learner (num_learners=0), it should already use the GPU, if available.

Why are these changes needed?

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

sven1977 and others added 6 commits October 28, 2024 18:15
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
… into fix_impala_gpu_loader_thread_and_local_learner
Signed-off-by: sven1977 <[email protected]>
@sven1977 sven1977 added rllib RLlib related issues rllib-algorithms An RLlib algorithm/Trainer is not learning. rllib-gpu-multi-gpu RLlib issues that's related to running on one or multiple GPUs rllib-newstack labels Oct 29, 2024
Copy link
Collaborator

@aslonnie aslonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems that it has merge conflicts now?

Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
@sven1977 sven1977 enabled auto-merge (squash) November 5, 2024 20:19
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
…accumulation_of_results_in_algorithm

Signed-off-by: sven1977 <[email protected]>

# Conflicts:
#	rllib/core/learner/tests/test_learner_group.py
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
@sven1977 sven1977 enabled auto-merge (squash) November 7, 2024 07:28
Signed-off-by: sven1977 <[email protected]>
@sven1977 sven1977 enabled auto-merge (squash) November 7, 2024 12:09
@sven1977 sven1977 merged commit 359f40a into ray-project:master Nov 7, 2024
6 checks passed
@sven1977 sven1977 deleted the fix_impala_gpu_loader_thread_and_local_learner branch November 7, 2024 13:04
@sven1977 sven1977 restored the fix_impala_gpu_loader_thread_and_local_learner branch November 8, 2024 08:24
@sven1977 sven1977 deleted the fix_impala_gpu_loader_thread_and_local_learner branch November 11, 2024 18:55
JP-sDEV pushed a commit to JP-sDEV/ray that referenced this pull request Nov 14, 2024
…U loader thread, enable local learner w/ GPU. (ray-project#48314)

Signed-off-by: JP-sDEV <[email protected]>
mohitjain2504 pushed a commit to mohitjain2504/ray that referenced this pull request Nov 15, 2024
…U loader thread, enable local learner w/ GPU. (ray-project#48314)

Signed-off-by: mohitjain2504 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests rllib RLlib related issues rllib-algorithms An RLlib algorithm/Trainer is not learning. rllib-gpu-multi-gpu RLlib issues that's related to running on one or multiple GPUs rllib-newstack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants